<?php
// {{{ includes
load_class('Controller_BoBase');
load_class('GD_FCKeditor');
// }}}

/**
 * 定义Controller_MBoAdmin
 *
 * @author jack
 * @todo 后台管理 
 */


class Controller_MBoAdmin extends Controller_BoBase {
	
	var $_modelAdmin;
	
	function Controller_MBoAdmin(){
		parent::Controller_BoBase();
		//$this->_modelActivity=get_singleton('Model_Activity');
	}
	
	
	function actionIndex(){
		 
		include(BACKEND_TPL_DIR.'/index.tpl.php');
	}
	
	function actionMain(){
			 
		include(BACKEND_TPL_DIR.'/main.tpl.php');
	}
	
	function actionLogin(){
		
		if($_POST['username'] == 'admin' && $_POST['password'] == '123456'){
			
			
			$_SESSION[get_app_inf('RBACSessionKey')]['USERID']=1;
			$_SESSION[get_app_inf('RBACSessionKey')]['USERNAME']='admin';
			
			$url=url('MBoAdmin','');
			redirect($url);
			
		}
		else{
			$this->_Login();
		}
	}
	
	function _Login($rowset='',$error=''){
		
		$token=$this->getToken();
		include(BACKEND_TPL_DIR.'/login.tpl.php');
	}
}



